<template>
  <body>
  <div>
    <IndexNavMenu ></IndexNavMenu>
    <router-view ></router-view>
  </div>
  </body>
</template>

<script>
import IndexNavMenu from './common/IndexNavMenu'
export default {
  name: 'IndexHome',
  components: {IndexNavMenu},
  mounted () {
    this.getWebInfo()
    this.setIcon()
  },
  methods: {
    getWebInfo () {
      var _this = this
      this.$axios.post('/api/web/get',
        this.$qs.stringify({
          webId: 1
        })
      ).then(function (response) {
        var data = response.data
        if (data.isSuccess) {
          _this.$store.commit('setWebInfo', data.result)
        }
      })
    },
    setIcon () {
      var the = this
      var link = document.querySelector("link[rel*='icon']") || document.createElement('link')
      link.type = 'image/x-icon'
      link.rel = 'shortcut icon'
      link.href = the.$store.state.web.logo
      document.getElementsByTagName('head')[0].appendChild(link)
    }
  }
}
</script>

<style scoped>
body{
  margin: 0px;
}
</style>
